package com.stepshop;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.junit.Test;

import com.stepshop.sys.bean.SysUser;

public class JavaBase {
	@Test
	public void test1(){
		List<SysUser> users=new ArrayList<SysUser>();
		for(int i=0;i<10;i++){
			SysUser user=new SysUser();
			user.setAddress("北京"+i);
			user.setId((long)i);
			users.add(user);
		}
//		for(SysUser u:users){
//			if(5l==u.getId()){
//				users.remove(u);
//			}
//		}
		Iterator<SysUser> it = users.iterator();
		while (it.hasNext()) {
			SysUser u = it.next();
			if(u.getId()==5l){
				it.remove();
			}
			
		}
		System.out.println(users.size());
	}
}
